package utils.data 
{
	import flash.utils.ByteArray;
	import flash.utils.Dictionary;
	/**
	 * 解析XML数据
	 * @author WLDragon 2014-02-23
	 */
	public class ParseXmlData implements IParseData
	{
		
		public function ParseXmlData() 
		{
			
		}
		
		public function parseData(bytes:ByteArray):Dictionary 
		{
			var dic:Dictionary = new Dictionary();
			bytes.position = 0;
			while (bytes.bytesAvailable)
			{
				var key:String = bytes.readUTF();
				var len:uint = bytes.readUnsignedInt();
				var data:XML = new XML(bytes.readUTFBytes(len));
				dic[key] = data;
			}
			return dic;
		}
		
	}

}